﻿using CL_VisionCommu_Test.Helper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CL_VisionCommu_Test
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void DataCommunication_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                DataGrid dataGrid = (DataGrid)sender;
                if (dataGrid != null)
                {
                    ItemDefined selectedRow = dataGrid.SelectedItem as ItemDefined;
                    if (selectedRow != null)
                    {
                        itemName.Text = selectedRow.Name;
                        ContentsName.Text = selectedRow.Default.ToString();
                    }
                }
            }
            catch (Exception)
            {
            }
           
        }

        private void Modbus_Checked(object sender, RoutedEventArgs e)
        {

        }

        private void TcpIp_Checked(object sender, RoutedEventArgs e)
        {

        }
    }
}
